//引入axios实例
import request from "@/utils/request"

//1.登录接口
//参数类型
export interface reqLoginParamType {
    username: string;
    password: string
}
//返回值类型
export interface reqLoginReturnType {
    token: string
}
//登录api
export const requestLogin = (userInfo: reqLoginParamType) => {
    return request.post<any , reqLoginReturnType>(`/admin/acl/index/login` , userInfo)
}

//2.请求用户信息接口
//返回值类型
export interface reqUserInFoReturnType {
    routes: string[];
    buttons: string[];
    roles: string[];
    name: string;
    avatar: string;
}
//请求用户信息api
export const requestUserInfo = () => {
    return request.get<any , reqUserInFoReturnType>(`/admin/acl/index/info`)
}

//3.退出登录接口
//退出登录api
export const requestLogout = () => {
    return request.post<any , null>(`/admin/acl/index/logout`)
}